//
//  HHNoticeView.h
//  HHChatKit
//
//  Created by Henry on 2021/9/26.
//

#import <UIKit/UIKit.h>
#import "HHNoticeContentProtocol.h"
@class HHNoticeView;

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, HHNoticeType) {
    HHNoticeTypeNone,
    HHNoticeTypeButton,
    HHNoticeTypeOpen,
    /// 自动消失，间隔时间默认：2s
    HHNoticeTypeAutoDismiss,
    HHNoticeTypeCustom,
};

@protocol HHNoticeViewDelegate <NSObject>

@required

- (void)noticeView:(HHNoticeView *)view updateHeight:(CGFloat)height;


@optional

- (void)noticeView:(HHNoticeView *)view clickTitle:(NSString *)title;

@end

@interface HHNoticeView : UIView

@property (nonatomic, weak) id <HHNoticeViewDelegate> delegate;

@property (nonatomic, copy) NSString *title;

@property (nonatomic, assign) HHNoticeType type;

@property (nonatomic, assign) NSTextAlignment titleAlignment;

/// 打开选项
@property (nonatomic, assign) BOOL open;

/// 50
@property (nonatomic, assign) CGFloat minHeight;
/// 160
@property (nonatomic, assign) CGFloat maxHeight;

/// type =  HHNoticeTypeAutoDismiss 有效， 自动消失，间隔时间默认：2s
@property (nonatomic, assign) CGFloat dismissDuration;

- (void)resetSize:(CGSize)size;

- (void)show:(UIView *)view title:(NSString *)title;
- (void)show:(UIView *)view title:(NSString *)title type:(HHNoticeType)type;
- (void)show:(UIView *)view title:(NSString *)title type:(HHNoticeType)type contentView:(nullable UIView<HHNoticeContentProtocol> *)contentView;

- (void)dismiss;

@end

NS_ASSUME_NONNULL_END
